<div class="top-fixed">
    <div class="navbar" style="max-width: 640px;margin: auto;">
        <div class="navbar-inner">
            <div class="left">
                <a href="javascript:history.back();" class=""><i class="fa fa-angle-left" style="font-size: 30px;"></i></a>
            </div>
            <div class="center">结算记录</div>
            <div class="right">
                <a href="javascript:;" opt="amount" opt-title="全部入账" opt-desc="确认全部结算入账？"
                   class="allAccountBtn weui_btn weui_btn_mini weui_btn_warn">全部入账</a>
            </div>
            <div class="right">
                <a href="javascript:;" opt="payed" opt-title="全部支付"
                   opt-desc="全部佣金直接转账给了代理？"
                   class="allAccountBtn weui_btn weui_btn_mini weui_btn_default">全部支付</a>
            </div>
        </div>
    </div>
</div>
<section class="main" style="max-width: 640px;margin: auto;">
    <div class="contact_con fs13">
        {{#if rows}}
            <ul class="list-wrapper">
                {{#each rows}}
                    <li class="bb">
                        <dl class="table ptb10">
                            <dt class="table-cell vm w70 plr10">
                                <div class="br50 item-pic">
                                    {{#if agency.image}}
                                        <img src="{{agency.image}}?imageView2/1/w/150/h/150/q/75" class="imgm">
                                    {{^}}
                                        <img src="images/default-none-head.png" class="imgm">
                                    {{/if}}
                                </div>
                            </dt>
                            <dd class="table-cell vm">
                                <p class="col3 single-line">代理: {{agency.nickname}} 「ID:{{agency.id}}」</p>
                            </dd>
                            <dd class="table-cell vm">
                                <p class="fs18 red bold tr pr10">
                                    {{agency_amount}}/{{agency_scale}}%
                                </p>
                            </dd>
                        </dl>
                        {{#if inviterAgency}}
                            <dl class="table ptb10">
                                <dt class="table-cell vm w70 plr10">
                                    <div class="br50 item-pic">
                                        {{#if inviterAgency.image}}
                                            <img src="{{inviterAgency.image}}?imageView2/1/w/150/h/150/q/75"
                                                 class="imgm">
                                        {{^}}
                                            <img src="images/default-none-head.png" class="imgm">
                                        {{/if}}
                                    </div>
                                </dt>
                                <dd class="table-cell vm">
                                    <p class="col3 single-line">上级代理: {{inviterAgency.nickname}}
                                        「ID:{{inviterAgency.id}}」</p>
                                </dd>
                                <dd class="table-cell vm">
                                    <p class="fs18 red bold tr pr10">
                                        {{inviter_agency_amount}}/{{inviter_agency_scale}}%
                                    </p>
                                </dd>
                            </dl>
                        {{/if}}
                        <div class="table index-nav fs12 tc">
                            <a href="javascript:;" class="table-cell  br">
                                <p class="fs18 red bold">
                                    {{settle_amount}}
                                </p>
                                <p>总佣金(元)</p>
                            </a>
                            <a href="javascript:;" class="table-cell  br">
                                <p class="fs18 blue bold">
                                    {{total_amount}}
                                </p>
                                <p>结算总佣金</p>
                            </a>
                            <a href="javascript:;" class="table-cell  br">
                                <p class="fs18 green bold">
                                    {{back_amount}}
                                </p>
                                <p>退回总佣金</p>
                            </a>
                        </div>

                        {{#if hasOpt}}
                            <div class="table partner-opt" data-id="{{id}}">
                                <dd class="table-cell vm p10">
                                    <a href="javascript:;" opt="amount" opt-title="确认入账"
                                       opt-desc="结算金额会进入代理账户余额"
                                       class="br3 bgf btn-mini btn-mini_outlined">确认入账</a>
                                </dd>
                                <dd class="table-cell vm p10 tr">
                                    <a href="javascript:;" opt="payed" opt-title="确认支付"
                                       opt-desc="佣金直接转账给了代理？"
                                       class="mr5 br3 btn-mini btn-mini_black bgf">确认支付</a>
                                </dd>
                            </div>
                        {{^}}
                            <div class="table partner-opt" data-id="{{id}}">
                                <dd class="table-cell green vm p10">
                                    {{statusName}}
                                </dd>
                            </div>
                        {{/if}}

                        <div class="table">
                            <dd class="table-cell vm p10">
                                <p class="col6">{{format_datetime created_at}}</p>
                            </dd>
                            <dd class="table-cell vm p10 tr">
                                <a href="/partner_orders?agency_settle_id={{id}}" class="blue ">查看订单明细</a>
                            </dd>
                        </div>
                    </li>
                {{/each}}
            </ul>

            <div class="loadmore-wrapper loadmore" style="margin: 10px;">
                {{#if loadmore}}
                    <div class="weui-infinite-scroll">
                        <div class="infinite-preloader"></div>
                        正在加载...
                    </div>
                {{/if}}
            </div>
        {{^}}
            <div class="tc nothing">
                <span class="mt10 fs14 col9">您还没有结算记录</span>
            </div>
        {{/if}}
    </div>
</section>